Personal tools
You are here: Home gvSIG Projects gvSIG Desktop Documentation User documentation gvSIG-Desktop 1.10. New functionalities (online)
gvSIG Desktop
gvSIG Desktop

Cached time 11/21/13 15:30:05 Clear cache and reload

 
Document Actions

gvSIG-Desktop 1.10. Nuevas funcionalidades

by Victor Acevedo last modified 2010-10-29 14:36

Now you know how to describe data and algorithms, so you have everything you need to run any algorithm. There is only one single command to execute algorithms: runalg. Its syntax is as follows:

> runalgname_of_the_algorithm, param1, param2, ..., paramN)

The list of parameters to add depends on the algorithm you want to run, and is exactly the list that the describealg method gives you, in the same order as shown.

Depending on the type of parameter, values are introduced differently. The next one is aquick review of how to introduce values for each type of input parameter

  • [Raster Layer], [Vector Layer]o [Table]. Simply introduce the name that identies the data object to use. If the input is optional and you do not want to use any data object, write #".
  • [Numerical value]. Directly type the value to use or the name of a variable containing that value.
  • [Selection]. Type the number that identies the desired option, as shown by the options command
  • [String]. Directly type the string to use or the name of a variable containing it.
  • [Boolean]. Type whether true" or false" (including quotes)
  • [Multiple selection - tipo datos]. Type the list of objects to use, separated by commas and enclosed between quotes.

For example, for the maxvaluegrid algorithm:

Usage: runalg("maxvaluegrid",
      INPUT[Multiple Input - Raster Layer]
      NODATA[Boolean],
      RESULT[Output raster layer])

The next line shows a valid usage example:

> runalg("maxvaluegrid", "lyr1, lyr2, lyr3", "false", "#")

Of course, lyr1, lyr2 and lyr3 must be valid layers already loaded into gvSIG.

When the multiple input is comprised of raster bands, each element is represented by a pair of values (layer, band). For example, for the cluster algorithm:

Usage: runalg ("cluster",
      INPUT[Multiple Input - Band]
      NUMCLASS[Numerical Value]) ***************

The next line shows a valid usage example:

> runalg("cluster, "lyr1, 1, lyr1, 2, lyr2, 2", 5, "#", "#")

The algorithm will use three bands, two of them from lyr1 (the first and the second ones of that layer) and one from lyr2 (its second band).

  • [Table Field from XXX ]. Write the name of the field to use. This parameter is case sensitive.
  • [Fixed Table ]. Type the list of all table values separated by commas and enclosed between quotes. Values start on the upper row and go from left to right. Here is an example:
runalg("kernelfilter", mdt25.asc, "-1, -1, -1, -1, 9, -1, -1, -1, -1", "#")
  • [Point ]. Write the pair of coordinates separated by commas and enclosed between quotes. For instance "220345, 4453616"

Input parameters such as strings or numerical values have default values. To use them, type "#" in the corresponding parameter entry instead of a value expression.

For output data objects, type the filepath to be used to save it, just as it is done from the toolbox. If you want to save the result to a temporary file, type "#".

Get freemind document

View source document Get permanent link


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: